#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
配置文件
存储系统配置参数
"""

# 网络配置
SERVER_HOST = 'localhost'
SERVER_PORT = 8443

# 证书配置
CERT_DIR = 'certs'
CA_CERT_FILE = f'{CERT_DIR}/ca-cert.pem'
CA_KEY_FILE = f'{CERT_DIR}/ca-key.pem'
SERVER_CERT_FILE = f'{CERT_DIR}/server-cert.pem'
SERVER_KEY_FILE = f'{CERT_DIR}/server-key.pem'
CLIENT_CERT_FILE = f'{CERT_DIR}/client-cert.pem'
CLIENT_KEY_FILE = f'{CERT_DIR}/client-key.pem'

# TLS配置
TLS_CIPHERS = 'ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:!aNULL:!MD5:!DSS'
SOCKET_TIMEOUT = 1.0

# ESP32模拟配置
SENSOR_DATA_INTERVAL = 5  # 传感器数据发送间隔(秒)
MAX_CLIENTS = 5  # 最大客户端连接数

# 传感器数据范围
TEMPERATURE_RANGE = (20.0, 30.0)  # 温度范围(°C)
HUMIDITY_RANGE = (40.0, 80.0)     # 湿度范围(%)
PRESSURE_RANGE = (1000.0, 1020.0) # 气压范围(hPa)
LIGHT_RANGE = (0, 1023)           # 光照范围

# 设备信息
DEVICE_INFO = {
    'device': 'ESP32',
    'firmware': 'v1.0.0',
    'capabilities': ['sensor_data', 'control', 'status']
}

# 日志配置
LOG_FORMAT = '[{timestamp}] {level}: {message}'
DATE_FORMAT = '%H:%M:%S'

# 证书生成配置
CERT_VALIDITY_DAYS = 365
CERT_KEY_SIZE = 4096
CERT_COUNTRY = 'CN'
CERT_STATE = 'Beijing'
CERT_CITY = 'Beijing'
CERT_ORGANIZATION = 'Test'
CERT_UNIT = 'Test'